<%--
  Created by IntelliJ IDEA.
  User: lidl
  Date: 2020/4/11
  Time: 12:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<jsp:include page="base.jsp"></jsp:include>
<div class="container-fluid">
    <form action="<%=request.getContextPath()%>/store/delete" method="POST">
        <table class="table table-striped table-hover">
            <div class="row">
                <div class="form-inline">
                    <button type="submit" class="btn btn-danger btn-sm ml-2 mr-3">删除选中的商品</button>
                    <a href="<%=request.getContextPath()%>/store/add">
                        <button type="button" class="btn btn-primary btn-sm">增加品类</button>
                    </a>
                </div>
            </div>
            <thead>
            <tr>
                <td>#</td>
                <td>编号</td>
                <td>名称</td>
                <td>库存</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${stores}" var="st">
                <tr>
                    <td><input type="checkbox" value=${st.getId()} name=${st.getId()} ></td>
                    <td><b>${st.getId()}</b></td>
                    <td>${st.getName()}</td>
                    <td>${st.getCount()}</td>
                    <td>
                        <div class="row">
                            <div class="form-inline">
                                <a type="button" class="btn btn-primary btn-sm mr-1"
                                   href="<%=request.getContextPath()%>/store/update?id=${st.getId()}">库存更新
                                </a>
                                <a type="button" class="btn btn-danger btn-sm"
                                   href="<%=request.getContextPath()%>/store/delete?id=${st.getId()}">删除
                                </a>
                            </div>
                        </div>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </form>
</div>
<script>
</script>
</body>
</html>
